<template>
    <div>
        <h2>CallBack</h2>
    </div>
</template>

<script setup>
import {ref,onMounted} from "vue"
// import {ElMessage} from 'element-plus'
import axios from 'axios'
import {useRouter} from 'vue-router'
import {useRoute} from 'vue-router'
// import http from "../http"; 

const router = useRouter()
const route = useRoute()
const code = route.query.code

// const ddcallback=()=>{
//   http.post("/myapp/ddlogin/?code="+code).then(res=>{
//     router.push('/Home1')
//   })
// }
const ddcallback = () => {
  http.get(`http://127.0.0.1:8000/maypp/ThirdPartyLoginCallback/?code=${code}`).then(res => {
    router.push('/UserCenter')
  })
}

onMounted(()=>{
  ddcallback()
})
</script>